<template>
	<view class="content">
		<!-- <view class="" style="background-color: #FFFFFF; padding-bottom: 10rpx;">
			<u-tabs active-color="#F0250E" :list="list1" :is-scroll="false" :current="current" @change="change"></u-tabs>
		</view> -->
		<view class="contentNEI">
			<view class="" v-for="(item, index) in list" :key="index">
				<view class="contentNEI_name">
					<view class="">
						<u-image shape="circle" width="70rpx" height="70rpx" :src="asyncImgs.free_order.fanxian"></u-image>
					</view>
					<view class="csl">
						<view class="contentNEI_name_text">
							{{item.desc}}
						</view>
						<view class="contentNEI_name_num" >
							+{{item.amount}}
						</view>
					</view>
				</view>
				<view class="contentNEI_name">
					<view class="" style="width: 70rpx;"></view>
					<view class="csl">
						<view class="orede_ades">
							{{item.order_no}}
						</view>
						<view class="orede_over" v-if="item.log_type==1">
							已收入
						</view>
						<view class="orede_over1" v-if="item.log_type==2">
							已支出
						</view>
					</view>
				</view>
				<view class="contentNEI_name mt14">
					<view class="" style="width: 70rpx;"></view>
					<view class="orede_ades ml20">
						生成时间：<text>{{item.created_at}}</text>
					</view>
				</view>
				<!-- <view class="contentNEI_name mt14">
					<view class="" style="width: 70rpx;"></view>
					<view class="orede_ades ml20">
						到账时间：<text>2022-04-12 17:01:14</text>
					</view>
				</view> -->
				<view class="" style="padding-left: 70rpx;">
					<view class="xian"></view>
				</view>
			</view>
		</view>
	<view class="remind">
		{{loadmore}}
	</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1: [{
					name: '全部'
				}, {
					name: '已收入'
				}, {
					name: '已支出',
				}],
				list:[],
				// src:require('../img/fanxian.png'),
				current: 0,
				loadmore:'下拉加载更多 ~',
				page:1,
				status:-1
			}
		},
		onLoad() {
			let params = {
				status: this.status,
				page: this.page,
			};
			this.getList(params)
		},
		onReachBottom() {
			this.loadmore = '加载中 ~',
			this.page++;
			this.getList({
				status: this.status,
				page: this.page,
			});
		},
		methods: {
			change(index) {
				this.current = index;
				if(this.current==0){
					this.status=-1
				}else if(this.current==1){
					this.status=1
				}else if(this.current==2){
					this.status=2
				}
				this.list = []
				let params = {
					status: this.status,
					page: 1,
				};
				this.getList(params)
				
				
			},
			// 获取初始化数据
			getList(params) {
				uni.showLoading({
					title: '加载中'
				});
				this.$allrequest.freeOrder.accumulatedDetails(params).then(res => {
				 uni.hideLoading()
				  if(res.data.totalCount=!0){
					  this.list = [...this.list, ...res.data.data];
					   if(res.data.data.length<=9){
						   this.loadmore="没有更多了 ~"
					   }else{
						   this.loadmore="下拉加载更多 ~"
					   }
				  }else{
					  this.loadmore="没有更多了 ~"
				  }
				  		
			});
		},
		}
	}
</script>

<style scoped>
	.xian{
		width: 634rpx;
		height: 2rpx;
		background: #F8F8F8;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		text-align: right;
		margin-top: 24rpx;
	}
	.orede_ades{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #8C8C8C;
		font-style: normal;
		text-transform: none;
	}
	.orede_over{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 26rpx;
		color: #8C8C8C;
		font-style: normal;
		text-transform: none;
	}
	.orede_over1{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 26rpx;
		color: #F0250E;
		font-style: normal;
		text-transform: none;
	}
	.content {
		background: #F2F2F2;
		min-height: 100vh;
	}

	.contentNEI {
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin-top: 24rpx;
		background-color: #FFF;
		margin-bottom: 24rpx;
	}

	.contentNEI_name {
		display: flex;
		padding-top: 24rpx;
	}

	.contentNEI_name_text {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 28rpx;
		color: #262626;
		font-style: normal;
		text-transform: none;
	}

	.contentNEI_name_num {
		font-family: PingFang SC, PingFang SC;
		font-weight: 600;
		font-size: 36rpx;
		color: #333333;
		font-style: normal;
		text-transform: none;
	}
	.csl{
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-grow: 1;
		margin-left: 20rpx;
	}
	.ml20{
		margin-left: 20rpx;
	}
	.mt14{
		margin-top: 14rpx;
	}
	.remind{
		text-align: center;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 22rpx;
		color: #C1C1C1;
		font-style: normal;
		text-transform: none;
		padding-bottom: 100rpx;
	}
</style>